// ignore_for_file: constant_identifier_names, avoid_print

import 'package:airbnb_clone/internal/http/request/friend_user_request.dart';

import '../../../models/response.dart';
import '../core/hi_net.dart';
import '../request/base_request.dart';

/// 与服务端通信 , 数据交互和持久化的操作都放在 DAO 层:
class FriendUserDao {
  static friend(int friendId) async {
    return await _send(friendId);
  }

  static _send(int friendId) async {
    BaseRequest request;
    request = FriendUserRequest();
    request
        .addJson("friend_id", friendId)
        .addHeader("Content-Type", "application/json");
    var result = await HiNet.getInstance().fire(request);
    TiebaResponse response = TiebaResponse.fromMap(result);
    return response;
  }
}
